package auctionsimulation.communication.command;

import auctionsimulation.agent.Agent;
import auctionsimulation.market.Auction;

public class BidCommand extends Command {

	private static final long serialVersionUID = -235620082699159131L;

	private Auction auction;
	private Agent bidder;
	private double price;

	public BidCommand(Auction auction, Agent bidder, double price) {
		this.auction = auction;
		this.bidder = bidder;
		this.price = price;
		if(this.auction == null || this.bidder == null || this.price <=0) {
			throw new IllegalCommandException("auction and bidder must not be null and price must be positive when creating an BidCommand");
		}
	}

	public Auction getAuction() {
		return this.auction;
	}

	public Agent getBidder() {
		return bidder;
	}

	public double getPrice() {
		return price;
	}
}
